package com.xnyzc.lhy.common.penum.approval;

/**
 * 审批事项
 * zhuyubin
 */
public enum EApprovalMatter {

    takeATaxi(0, "打车", 1L),
    leave(1, "请假", 2L),
    reimburse(2, "报销", 3L),
    overtime(3, "加班", 4L),
    otherTypes(4, "自定义其他类型", 5L),
    personalAmountApproval(5, "个人额度提额申请", 710066282135555L),
    officeAmountApproval(6, "部门额度提额申请", 710066282135556L);

    private Integer value;
    private String desc;
    private Long approvalId;

    EApprovalMatter(Integer value, String desc, Long approvalId) {
        this.value = value;
        this.desc = desc;
        this.approvalId = approvalId;
    }

    public static EApprovalMatter findById(Integer value) {
        EApprovalMatter eApprovalMatter;
        switch (value) {
            case 0:
                eApprovalMatter = EApprovalMatter.takeATaxi;
                break;
            case 1:
                eApprovalMatter = EApprovalMatter.leave;
                break;
            case 2:
                eApprovalMatter = EApprovalMatter.reimburse;
                break;
            case 3:
                eApprovalMatter = EApprovalMatter.overtime;
                break;
            case 4:
                eApprovalMatter = EApprovalMatter.otherTypes;
                break;
            case 5:
                eApprovalMatter = EApprovalMatter.personalAmountApproval;
                break;
            case 6:
                eApprovalMatter = EApprovalMatter.officeAmountApproval;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eApprovalMatter;
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }

    public Long getApprovalId() {
        return this.approvalId;
    }
}
